package com.intramirror.product.service;

import com.intramirror.product.entity.Promotion;
import com.intramirror.product.enums.PromotionRuleTypeEnum;
import java.util.List;
import java.util.Map;

public interface IPromotionService {

    void refreshSnapshotProductByPromotion(Long promotionId);

    void refreshSnapshotForAddProduct(Long productId);

    void refreshBatchSnapshotForAddProduct(List<Long> productIds);

    List<Map<String, Object>> getActivePromotionByBannerId(Long bannerId) throws Exception;

    int setCampaignActiveTime(Promotion campaign);

    Promotion copyCampaignToBanner(Long bannerId, Long campaignId, String campaignName, Long startTime);

    /**
     * 删除campaign
     * @param campaign
     */
    String deleteCampaign(Promotion campaign);

    /**
     * 新建campaign
     * @param bannerId
     * @param campaignName
     * @param startTime
     * @return
     */
    int newCampaignByBanner(Long bannerId, String campaignName, Long startTime);

    /**
     * 查询已设置规则的vendor
     * @param promotionId
     * @return
     */
    List<Map<String, Object>> getPromotionBoutiqueHasRuleList(Long promotionId);

    /**
     * 查询promotion中vendor的season列表
     * @param params
     * @return
     */
    List<Map<String, Object>> getPromotionBoutiqueSeason(Map<String, Object> params);

    /**
     * 查询promotion中vendor的每个season的商品数量
     * @param params
     * @return
     */
    List<Map<String, Object>> getPromotionBoutiqueProductCountBySeason(Map<String, Object> params);

    /**
     * 查询promotion排除的商品数量
     * @param promotionId
     * @return
     */
    Integer getPromotionBoutiqueExcludeProductCount(Long promotionId);

    /**
     * 查询单个promotion信息
     * @param promotionId
     * @return
     */
    Map<String, Object> getPromotionById(Long promotionId);

    /**
     * @param seasonCode
     * @param vendor
     * @param ruleType
     * @param promotionId
     * @return
     */
    Boolean removePromotionRule(String seasonCode, Long vendor, PromotionRuleTypeEnum ruleType, Long promotionId);

    /**
     * @param vendor
     * @param promotionId
     * @return
     */
    Boolean removePromotionRuleByVendor(String seasonCode, Long vendor, Long promotionId);

    /**
     * @param vendorId
     * @param orderBy
     * @return
     */
    List<Map<String, Object>> getExcludeProductGroup(Long vendorId, String orderBy);

    /**
     * @param promotionId
     * @param tagId
     * @return
     */
    Boolean addExcludeProductGroup(Long promotionId, Long tagId);

    /**
     * @return
     */
    List<Map<String, Object>> excludeProductGroupByVendor();

    /**
     * @param
     * @return
     */
    int deleteExcludeProductGroup(List<Long> ids);

    /**
     * @param promotionId
     * @return
     */
    List<Map<String, Object>> getExcludeProductGroupByPromotionId(Long promotionId);
}
